$(document).ready(function(){
	ghf.init();
});
var ghf = {
	init : function(){
		var w = $(window);
		w.resize(function(){
			$("#contents").height($(window).height()-$("#header").height() - $("#footer").height());
		});
		w.resize();
		var lis = $("#footer ul li");
		for(var i = 0 ; i < lis.size() ;i++){
			$(lis[i]).css("width",Math.abs(100/lis.size())+"%");
		}
		$("#test").checkbox();
	}
};
jQuery.fn.extend({
	checkbox : function(){
		var div = $('<div class="checkbox"><div class="box"><span>开启</span><div class="pointer"></div></div><div class="clear"></div></div>');
		$(this).before(div);
		$(this).hide();
		div.append($(this));
		div.find("span").click(function(){
			if($(this).html() == "开启"){
				$(this).html("关闭").css("float","right").next(".pointer").animate({"float":"left"},1000);//.css("float","left");
			}else{
				$(this).html("开启").animate({"float":"left"},1000).next(".pointer").css("float","right");
			}
		});
	}
});